import { lazy } from 'react'
import { RouteBaseType, RouteType,RouteTreeType,RouteNoNameTreeType } from './DataType'
import PlatformRouter from './Platform'
import ProjectRouter from '@/router/Project'
const Test = lazy(() => import('@/pages/test'))
const PageNotFound = lazy(() => import('@/pages/PageNotFound'))
// const PageNotFound2=() => import('@/pages/PageNotFound')
//  Suspense 与lazy配合使用;
//  如果不用lazy,会显示加载静态资源超标.
//  如果用了lazy,就必须用<Suspense>, 否则会无法正常跳转路由
const routes: Array<RouteType>= [
  {
    path: '/test',
    component: Test,
    children: [

    ]
  },
  {
    path: '/',
    name:'首页',
    component: lazy(() => import('@/pages/home')),
    children:[
      PlatformRouter,
      ProjectRouter
    ]
  },
  {
    path: '/login',
    component: lazy(() => import('@/pages/login')),
  },
  {
    path: '/*',
    component: PageNotFound,
    children: []
  },
  {
    path: '/wrong',
    component: lazy(() => import('@/pages/WrongUrl')),
    children: []
  }
]
export default routes
